package com.ureport.test;

import com.bstek.ureport.console.UReportServlet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ImportResource;

/**
 * @Author 尚智江
 * @description
 * @CreateDate 2023/11/30 14:12
 */

@EnableAutoConfiguration
@ImportResource("classpath:context.xml")
public class UreportMain {
    public static void main(String[] args) {
        SpringApplication.run(UreportMain.class, args);
    }

    @Bean
    public ServletRegistrationBean buildUReportServlet(){
        return new ServletRegistrationBean(new UReportServlet(),"/ureport/*");
    }
}

/**
 * com.mysql.cj.jdbc.Driver
 * jdbc:mysql://127.0.0.1:3306/baskreportsample?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai

 预览对应的文件
   http://localhost:8080/ureport/preview?_u=file:emplee.ureport.xml
 下载对应的pdf文件
 http://localhost:8080/ureport/pdf?_u=file:emplee.ureport.xml

 http://localhost:8080/ureport/pdf?_u=file:身元保证书.ureport.xml
 http://localhost:8080/ureport/pdf?_u=file:身元2.0.ureport.xml
 37
 7
 */
